//
//  THMineGroupTableViewCell.m
//  TreeHole
//
//  Created by apple on 2020/9/1.
//  Copyright © 2020 stoneobs. All rights reserved.
//

#import "THMineGroupTableViewCell.h"

@interface THMineGroupTableViewCell()
@property(nonatomic, strong) STButton                     *iconButton;/**<  */

@property(nonatomic, strong) STLabel                     *nameLable;/**<  */
@property(nonatomic, strong) STLabel                     *phoneLable;/**<  */
@property(nonatomic, strong) STLabel                     *timeLable;/**<  */
@property(nonatomic, strong) STLabel                     *moneyLable;/**<  */
@end
@implementation THMineGroupTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self stoneobs_ui_configSubView];
    }
    return self;
}
+ (CGFloat)stoneobs_ui_cell_height{
    return 70;
}
#pragma mark --configSubView
- (void)stoneobs_ui_configSubView{
    
    STButton * stoneobs_ui_button = [[STButton alloc] initWithFrame:CGRectMake(15, 15, 40, 40)
                                                              title:nil
                                                         titleColor:nil
                                                          titleFont:0
                                                       cornerRadius:20
                                                    backgroundColor:nil
                                                    backgroundImage:nil
                                                              image:nil];
    self.iconButton = stoneobs_ui_button;
    [self.contentView addSubview:stoneobs_ui_button];
    
    CGFloat witdh = UISCREEN_WIDTH / 5;
    
    ({
        STLabel * stoneobs_ui_label = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right+10, 16, 3*witdh - self.iconButton.right - 10, 20)
                                                                text:@"sasd"
                                                           textColor:STONEOBS_UI_FIRST_TEXT_COLOR
                                                                font:13
                                                         isSizetoFit:NO
                                                       textAlignment:NSTextAlignmentLeft];
        [self.contentView addSubview:stoneobs_ui_label];
        stoneobs_ui_label.font = [UIFont fontWithName:STONEOBS_UI_FONT_CU_NAME size:13];
        self.nameLable = stoneobs_ui_label;
    });
    
    ({
        STLabel * stoneobs_ui_label = [[STLabel alloc] initWithFrame:CGRectMake(self.iconButton.right+10, 0, 3*witdh - self.iconButton.right - 10, 20)
                                                                text:@"sasd"
                                                           textColor:STONEOBS_UI_THIRD_TEXT_COLOR
                                                                font:13
                                                         isSizetoFit:NO
                                                       textAlignment:NSTextAlignmentLeft];
        [self.contentView addSubview:stoneobs_ui_label];
        self.phoneLable = stoneobs_ui_label;
        stoneobs_ui_label.bottom = self.iconButton.bottom;
    });
    
    ({
        STLabel * stoneobs_ui_label = [[STLabel alloc] initWithFrame:CGRectMake(3*witdh, 0, witdh , self.class.stoneobs_ui_cell_height)
                                                                text:@"sasd"
                                                           textColor:STONEOBS_UI_THIRD_TEXT_COLOR
                                                                font:13
                                                         isSizetoFit:NO
                                                       textAlignment:NSTextAlignmentCenter];
        [self.contentView addSubview:stoneobs_ui_label];
        self.timeLable = stoneobs_ui_label;
    });
    
    ({
        STLabel * stoneobs_ui_label = [[STLabel alloc] initWithFrame:CGRectMake(4*witdh, 0, witdh , self.class.stoneobs_ui_cell_height)
                                                                text:@"sasd"
                                                           textColor:STONEOBS_UI_FIRST_TEXT_COLOR
                                                                font:14
                                                         isSizetoFit:NO
                                                       textAlignment:NSTextAlignmentCenter];
        [self.contentView addSubview:stoneobs_ui_label];
        stoneobs_ui_label.font = [UIFont fontWithName:STONEOBS_UI_FONT_CU_NAME size:14];
        self.moneyLable = stoneobs_ui_label;
    });
}
- (void)setModel:(THMineGroupItemModel *)model{
    _model = model;
    [self.iconButton sd_setImageWithURL:model.header_img.mj_url forState:UIControlStateNormal];
    self.nameLable.text = model.name;
    self.phoneLable.text = [NSString stringWithFormat:@"手机号%@",model.phone];
    self.timeLable.text = model.created_time;
    self.moneyLable.text = [NSString stringWithFormat:@"+%@",model.rebate];
}
@end
